using System;
using Gtk;

public partial class MainWindow: Gtk.Window
{	
	public MainWindow (): base (Gtk.WindowType.Toplevel)
	{
		Build ();
	}

	protected void OnDeleteEvent (object sender, DeleteEventArgs a)
	{
		Application.Quit ();
		a.RetVal = true;
	}

	protected void  handler (object sender, EventArgs e)
	{
		MessageDialog dialog = new MessageDialog (this, DialogFlags.Modal,
		                                         MessageType.Warning, ButtonsType.YesNo, "Please Click Yes or No");
		dialog.Response += (o, args) => 
		{
			if (args.ResponseId == ResponseType.Yes){
				label1.Text = "You clicked yes, way to go!!!";
			}
			else{
				label1.Text = "Why would you have clicked no...";
			}
			dialog.Hide();
		};

		dialog.Close += (object dialogSender, EventArgs closeEventArg) => 
		{

		};
		dialog.Show();
	}
}
